package com.bing.bingPro.service.impl;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.bing.bingPro.controller.vo.ComYbWcqkVo;
import com.bing.bingPro.entity.ComYbWcqk;
import com.bing.bingPro.mapper.ComYbWcqkMapper;
import com.bing.bingPro.service.ComYbWcqkService;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.stream.Collectors;

/**
 * @author 29821
 * @description 针对表【com_yb_wcqk(完成情况)】的数据库操作Service实现
 * @createDate 2023-05-31 14:19:46
 */
@Service
public class ComYbWcqkServiceImpl extends ServiceImpl<ComYbWcqkMapper, ComYbWcqk>
        implements ComYbWcqkService {


    @Override
    public List<ComYbWcqkVo> ListVo() {
        return baseMapper.selectList(Wrappers.lambdaQuery(ComYbWcqk.class)
                        .eq(ComYbWcqk::getIsDeleted, "0"))
                .stream()
                .map(comYbWcqk -> {
                    ComYbWcqkVo comYbWcqkVo = new ComYbWcqkVo();
                    comYbWcqkVo.setWcqk(comYbWcqk.getWcqk());
                    comYbWcqkVo.setJdz(comYbWcqk.getJdz());
                    comYbWcqkVo.setXmmc(comYbWcqk.getXmmc());
                    comYbWcqkVo.setJdz(comYbWcqk.getJdz());
                    return comYbWcqkVo;
                }).collect(Collectors.toList());
    }
}




